/*
 * @lc app=leetcode.cn id=520 lang=javascript
 *
 * [520] 检测大写字母
 */

// @lc code=start
/**
 * @param {string} word
 * @return {boolean}
 */
var detectCapitalUse = function(word) {
 
};
// @lc code=end

var detectCapitalUse = function(word) {
    if(word[0].toUpperCase()===word[0])
    {return  (word.slice(1,word.length).toUpperCase()===word.slice(1,word.length))||(word.slice(1,word.length).toLowerCase()===word.slice(1,word.length))}
    else{
        return word.toLowerCase()===word
    }
};//BF